package com.tedu.bill.demo6;

/**
 * Author：毕龙
 * Date: 2024/4/26 20:48
 */
public class School {
    public void assignTeach(int n){
        if(n == 1){
          /* class BiLong extends Teacher{
                public void teacher(){
                    System.out.println("老师教java");
                }
            }
            BiLong bl = new BiLong();
            bl.teacher();

            Teacher t1 = new Teacher() {
                public void teacher() {
                    System.out.println("老师教java");
                }
            };
            t1.teacher();*/
           Teacher t1 = new Teacher() {
                public void teacher() {
                    System.out.println("老师教java");
                }
            };
            t1.teacher();


        }else{
            /*class YanHua{
                public void teacher(){
                    System.out.println("老师教销售");
                }
            }
            new YanHua().teacher();*/
            new Teacher() {
                @Override
                public void teacher() {
                    System.out.println("老师教销售");
                }
            }.teacher();
        }
    }
}
